package com.sl.au.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sl.au.entity.EventRegister;
import com.sl.au.entity.EventReport;
import com.sl.au.entity.EventTask;
import com.sl.au.entity.EventToEvaluateUser;
import com.sl.au.entity.UserSingle;
import com.sl.au.repository.EventRegisterRepository;
import com.sl.au.repository.EventReportRepository;
import com.sl.au.repository.EventTaskRepository;
import com.sl.au.repository.EventToEvaluateUserRepository;
import com.sl.au.service.EventReportOuterService;

@Service("EventReportOuterService")
@Transactional
public class EventReportOuterServiceImpl extends BaseServiceImpl implements EventReportOuterService {
	@Autowired
	EventReportRepository eventReportRepository;
	@Autowired
	EventRegisterRepository eventRegisterRepository;
	@Autowired
	EventToEvaluateUserRepository eventToEvaluateUserRepository;

	@Autowired
	private EventTaskRepository eventTaskRepository;

	@Override
	public EventReportRepository getEventReportRepository() {
		return this.eventReportRepository;
	}

	@Override
	public EventRegisterRepository getEventRegisterRepository() {
		return this.eventRegisterRepository;
	}

	@Override
	public void saveAll(EventReport eventReport, EventTask reportTask) {
		eventReportRepository.save(eventReport);
		eventTaskRepository.save(reportTask);
	}

	@Override
	public void saveAll(EventReport eventReport, EventTask reportTask, EventRegister eventRegister,
			EventTask registerTask,List<EventToEvaluateUser> dlist) {
		eventReportRepository.save(eventReport);
		eventTaskRepository.save(reportTask);
		eventRegisterRepository.save(eventRegister);
		eventTaskRepository.save(registerTask);
		eventToEvaluateUserRepository.save(dlist);
	}
}
